{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9c326d5b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 运行程序后，让用户输入支付宝余额 ✔，然后打印我们的商品列表给用户。✔"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4bcfe4c9",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unexpected EOF while parsing (4158594633.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [2]\u001b[1;36m\u001b[0m\n\u001b[1;33m    product_list = [\u001b[0m\n\u001b[1;37m                    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unexpected EOF while parsing\n"
     ]
    }
   ],
   "source": [
    "product_list = ["
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5d3e4125",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(['蜜雪柠檬水', 6],)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " [\"蜜雪柠檬水\",6],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "184a6bfb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(['蜜桃四季春', 10],)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[\"蜜桃四季春\",10],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "2997aaae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(['芒果奶盖', 12],)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[\"芒果奶盖\",12],"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "aded1427",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['葡萄波波奶茶', 8]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[\"葡萄波波奶茶\",8]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "d0a72434",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unmatched ']' (1890416573.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Input \u001b[1;32mIn [7]\u001b[1;36m\u001b[0m\n\u001b[1;33m    ]\u001b[0m\n\u001b[1;37m    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unmatched ']'\n"
     ]
    }
   ],
   "source": [
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "a8f4c3bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "shopping_car =[]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8ab7a8c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "AliPay = int(input(\"请输入余额：\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "069e978f",
   "metadata": {},
   "outputs": [],
   "source": [
    "while True:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6fb31793",
   "metadata": {},
   "outputs": [],
   "source": [
    " print(\"----------商品列表----------\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a72cbff7",
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(4):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b830b11e",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(\"商品序号\",\"(\"+str(i)+\")：\",product_list[i][0],str(product_list[i][1])+\"元\")  # 格式化输出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c85e4e0f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 让用户输入商品编号进行商品的购买。:直接用商品列表的 index 作为商品标号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "59bbe7d1",
   "metadata": {},
   "outputs": [],
   "source": [
    "user_choice = input(\"请输入商品编号：\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f3e13723",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 情景1：用户正在购买，输入商品编号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "85b91064",
   "metadata": {},
   "outputs": [],
   "source": [
    "if user_choice.isdigit():"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ab369c77",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
